import axios from '@/libs/api.request'
import {
  LEFT_MENU_LIST,
  MENU_ADD,
  MENU_EDIT,
  MENU_EDIT_ICON,
  MENU_DELETE
} from './list'

// 树list数据
export const listAllMenu = () => {
  return axios.request({
    url: LEFT_MENU_LIST,
    method: 'GET'
  })
}

// 添加菜单
export const addMenu = data => {
  return axios.request({
    url: MENU_ADD,
    params: data,
    method: 'put'
  })
}

// 编辑菜单
export const editMenu = data => {
  return axios.request({
    url: MENU_EDIT,
    params: data,
    method: 'put'
  })
}

// 编辑菜单icon
export const editMenuIcon = data => {
  return axios.request({
    url: MENU_EDIT_ICON,
    params: data,
    method: 'put'
  })
}

// 删除菜单
export const deleteMenu = data => {
  return axios.request({
    url: MENU_DELETE,
    params: data,
    method: 'DELETE'
  })
}
